feat(generated): Add new event types and user object to membership models#642
Conversation
Greptile SummaryThis auto-generated PR adds new
Confidence Score: 3/5Two P1 breaking changes need review before merging: a removed public import path and a new required field that will fail deserialization of older responses. Two independent P1 findings — a hard import break and a deserialization break — lower the score below the P1 ceiling of 4. The rest of the additions (new event types, optional name fields, type aliases) are clean and well-tested. src/workos/authorization/models/init.py (removed export) and src/workos/user_management/models/organization_membership.py (required user field). Important Files Changed
|
| ) | ||
| from .update_organization_role import UpdateOrganizationRole as UpdateOrganizationRole | ||
| from .update_role import UpdateRole as UpdateRole | ||
| from .user_organization_membership_base_list_data import ( | ||
| UserOrganizationMembershipBaseListData as UserOrganizationMembershipBaseListData, | ||
| from .user_organization_membership_base_with_user import ( | ||
| UserOrganizationMembershipBaseWithUser as UserOrganizationMembershipBaseWithUser, | ||
| ) |
There was a problem hiding this comment.
Breaking removal of
UserOrganizationMembershipBaseListData from authorization exports
UserOrganizationMembershipBaseListData has been entirely removed from workos.authorization.models and the underlying file deleted from the authorization/models/ directory. Any existing consumer that imports this class from its documented location (from workos.authorization.models import UserOrganizationMembershipBaseListData) will receive an ImportError after upgrading. The class is now only available from workos.groups.models.
Without a re-export shim (e.g. from workos.groups.models import UserOrganizationMembershipBaseListData as UserOrganizationMembershipBaseListData in the old __init__.py) or a deprecation warning, this constitutes a hard breaking change. Consider whether a major version bump or a compatibility alias is needed.
| user: "User" | ||
| """The user that belongs to the organization through this membership.""" |
There was a problem hiding this comment.
user is a required field with no default — hard-breaks deserialization of existing responses
user: "User" has no default value and from_dict accesses it via data["user"] (line 63). Any cached, logged, or replayed OrganizationMembership JSON that predates this API change will raise a KeyError (caught and re-raised as a deserialization error) at runtime. If the API does not guarantee this field on all endpoints that return OrganizationMembership (e.g. paginated lists that may omit nested objects), this will cause silent breakage in production.
If the field may legitimately be absent on some endpoints, it should be Optional["User"] = None to preserve backward compatibility. If the API always returns it, this is low-risk but the breaking deserialization behavior should be called out in release notes.
Summary
DsyncTokenCreated,DsyncTokenCreatedData,DsyncTokenDeleted, andDsyncTokenDeletedDataclasses for directory sync token lifecycle eventsUserOrganizationMembershipBaseWithUserclass (renamed from internalUserOrganizationMembershipBaseListDatain authorization) that includes nested user objectnamefield toDirectoryUser,DsyncUserUpdatedData,DirectoryUserWithGroups, andProfilemodels for full user nameuserfield toOrganizationMembershipto include user object in membership responsesApiKeyValidationResponseApiKeyandApiKeyValidationResponseApiKeyOwnertype aliases for API key validation responsesADMIN_PORTALtoEventContextActorSourceenum for admin portal event source trackingUserOrganizationMembershipBaseListDatafrom authorization to groups module for better code organizationTriggered by workos/openapi-spec@91fc76a